@echo off

REM =====================================================================
REM 
REM   File:      UninstallProvider.cmd
REM   Summary:   Script to execute the SQL Remote Blob Storage provider 
REM              uninstallation utility.
REM              Defaults to uninstalling the provided File Store Provider
REM              and removing it from being the default provider.
REM   Date:      June 30th, 2008

REM ---------------------------------------------------------------------

REM   This file is part of the Microsoft SQL Server Code Samples.
REM   Copyright (C) Microsoft Corporation.  All rights reserved.

REM This source code is intended only as a supplement to Microsoft
REM Development Tools and/or on-line documentation.  See these other
REM materials for detailed information regarding Microsoft code samples.

REM THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
REM KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
REM IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
REM PARTICULAR PURPOSE.

REM ======================================================= */

REM Sets the name of the provider in the RBS instance. This must be unique 
REM for each provider instance registered with RBS, however multiple store 
REM registrations can use the same provider library with different 
REM configuration options.
set ProviderName=FileStoreProvider_1

REM This is the database server name used to create the connection string for 
REM the server connection. Can also include an instance name in the form 
REM ServerName\InstanceName.
set ServerName=(local)

REM This is the catalog/database name used to create the connection string for 
REM the server connection. This database must have had RBS installed using the 
REM MSI or stored procedure.
set DatabaseName=RemoteBlobStorage

echo ------------------------------------- 
echo Unregistering File Store Provider
echo SQL Server Instance: %ServerName%
echo Database: %DatabaseName%
echo ProviderName: %ProviderName%
echo.

InstallProvider.exe -uninstall -name %ProviderName% -server %ServerName% -database %DatabaseName%


